$(".allList").children("li").click(function(){
    $("html").animate({
        scrollTop:$(".floor").eq($(this).index()).offset().top
    })
})
class Index{
    constructor(){
        this.login = document.querySelector(".floor");
        this.welcome = document.querySelector(".welcome");
        this.logout = document.getElementById("logout");
        this.uName = document.getElementById("userName")

        this.init();
        this.addEvent();
    }
    init(){
        this.m = sessionStorage.getItem("userMsg");
        this.m = this.m ? JSON.parse(this.m) : {};
        if(this.m.user){
            this.uName.innerHTML = this.m.user;
            this.login.style.display = "none";
            this.welcome.style.display = "flex";
        }
    }
    addEvent(){
        var that = this;
        this.logout.onclick = function(){
            sessionStorage.removeItem("userMsg");
            location.reload();
        }
    }
}
new Index;